package ge.telasi.tasks.ui.flowpermission;

import ge.telasi.tasks.model.FlowPermission;
import ge.telasi.tasks.model.Task;
import ge.telasi.tasks.ui.UIUtils;
import javax.swing.Icon;

/**
 * @author dimitri
 */
public class FlowPermissionDecorationUtils {

    public static final String getTaskTypeName(int type) {
        switch(type) {
            case Task.TYPE_GENERAL:
                return "ზოგადი დავალება";
            default:
                return "?";
        }
    }

    public static final Icon getTaskTypeIcon(int type) {
        switch(type) {
            case Task.TYPE_GENERAL:
                return UIUtils.getIcon16x16("email.png");
            default:
                return null;
        }
    }

    public static final String getOperationName(int operation) {
        switch (operation) {
            case FlowPermission.OPERATION_CHANGE_SUBJECT:
                return "სათაურის შეცვლა";
            case FlowPermission.OPERATION_CHANGE_PRIORITY:
                return "პრიორიტეტის  შეცვლა";
            case FlowPermission.OPERATION_CHANGE_RECEIVERS:
                return "მიმღებთა შეცვლა";
            case FlowPermission.OPERATION_CHANGE_STATUS:
                return "სტატუსის შეცვლა";
            case FlowPermission.OPERATION_ADD_ATTACHMENT:
                return "ფაილის დამატება";
            case FlowPermission.OPERATION_REMOVE_ATTACHMENT:
                return "ფაილის წაშლა";
            case FlowPermission.OPERATION_DOWNLOAD_ATTACHMENT:
                return "ფაილის გადმოწერა";
            case FlowPermission.OPERATION_DELETE_TASK:
                return "დავალების წაშლა";
            case FlowPermission.OPERATION_ADD_PARENT:
                return "საფუძველის დამატება";
            case FlowPermission.OPERATION_REMOVE_PARENT:
                return "საფუძველის გაუქმება";
            default:
                return "?";
        }
    }

    public static final Icon getOperationIcon(int operation) {
        switch (operation) {
            case FlowPermission.OPERATION_CHANGE_SUBJECT:
                return UIUtils.getIcon16x16("page_edit.png");
            case FlowPermission.OPERATION_CHANGE_PRIORITY:
                return UIUtils.getIcon16x16("clock_edit.png");
            case FlowPermission.OPERATION_CHANGE_RECEIVERS:
                return UIUtils.getIcon16x16("group_edit.png");
            case FlowPermission.OPERATION_CHANGE_STATUS:
                return UIUtils.getIcon16x16("cog.png");
            case FlowPermission.OPERATION_ADD_ATTACHMENT:
                return UIUtils.getIcon16x16("package_add.png");
            case FlowPermission.OPERATION_REMOVE_ATTACHMENT:
                return UIUtils.getIcon16x16("package_delete.png");
            case FlowPermission.OPERATION_DOWNLOAD_ATTACHMENT:
                return UIUtils.getIcon16x16("package_go.png");
            case FlowPermission.OPERATION_DELETE_TASK:
                return UIUtils.getIcon16x16("delete.png");
            case FlowPermission.OPERATION_ADD_PARENT:
                return UIUtils.getIcon16x16("feed_add.png");
            case FlowPermission.OPERATION_REMOVE_PARENT:
                return UIUtils.getIcon16x16("feed_delete.png");
            default:
                return null;
        }
    }

}
